home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 731 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.1 KB

  1. From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
  2. Date: Mon, 27 Dec 93 10:33:44 +0100
  3. Message-Id: <9312270933.AA10270@issan.informatik.uni-dortmund.de>
  4. To: mint@atari.archive.umich.edu
  5. Subject: MiNT 1.09: no bell under TOS 1.04
  6.  
  7. On TOS 1.04, when calling Bconout(2,'\a') the VDI jumps directly back
  8. to the BIOS for ringing the bell. But the BIOS expects the register A5
  9. to be set to zero, for checking conterm and setting internal
  10. variables.  Now when calling Bconout directly through the vector at
  11. 0x57e and *not* through trap #13, the register A5 has undefined value,
  12. resulting in the wrong address to be tested, or, worse, the wrong
  13. address to be written to.
  14.  
  15. A workaround is to clear register A5 in callout2.
  16.  
  17. --- orig/inline.h    Fri Jun 25 22:17:54 1993
  18. +++ inline.h    Sat Dec 25 14:33:26 1993
  19. @@ -55,6 +55,10 @@
  20.      retvalue;                \
  21.  })
  22.  
  23. +/* On TOS 1.04, wenn calling Bconout(2,'\a') the VDI jumps directly
  24. +   back to the BIOS which expects the register A5 to be set to zero.
  25. +   (Specifying the register as clobbered does not work.) */
  26. +
  27.  #define callout2(func, a, b)            \
  28.  ({                        \
  29.      register long retvalue __asm__("d0");    \
  30. @@ -66,11 +70,13 @@
  31.      ("  moveml d5-d7/a4-a6,sp@-;        \
  32.          movew %3,sp@-;            \
  33.          movew %2,sp@-;            \
  34. -        jsr %1@;                \
  35. +        movel %1,a0;            \
  36. +        subal a5,a5;            \
  37. +        jsr a0@;                \
  38.          addqw #4,sp;            \
  39.          moveml sp@+,d5-d7/a4-a6 "        \
  40.      : "=r"(retvalue)    /* outputs */    \
  41. -    : "a"(_f), "r"(_a), "r"(_b) /* inputs */ \
  42. +    : "r"(_f), "r"(_a), "r"(_b) /* inputs */ \
  43.      : "d0", "d1", "d2", "d3", "d4",        \
  44.        "a0", "a1", "a2", "a3" /* clobbered regs */ \
  45.      );                    \
  46. --- orig/syscall.spp    Wed Aug 18 19:02:12 1993
  47. +++ syscall.spp    Sat Dec 25 12:57:16 1993
  48. @@ -429,11 +429,14 @@
  49.  ; passing 16 bits (and since the called function will just
  50.  ; ignore any extra arg)
  51.  ;
  52. +; On TOS 1.04, when calling Bconout(2,'\a') the VDI jumps directly
  53. +; back to the BIOS which expects the register A5 to be set to zero.
  54.  
  55.  _callout1:
  56.  _callout2:
  57.      movem.l    4(sp),a0/a1        ; get function ptr & args
  58.      movem.l    d2-d7/a2-a6,-(sp)    ; save reggies
  59. +    suba.l    a5,a5            ; kludge for TOS 1.04
  60.      move.l    a1,-(sp)        ; push args
  61.      jsr    (a0)            ; do function
  62.      addq.w    #4,sp
  63.